import request from '@/utils/request'

// 文章

// 所有
export function getAllArticles(params) {
  return request({
    url: '/articles/all',
    method: 'get',
	params: params
  })
}

// 分类查询
export function getArticlesByCategoryId(params) {
  return request({
    url: '/articles/categoryId',
    method: 'get',
	params: params
  })
}

export function addOrEditArticle(data) {
    return request({
        url: '/admin/articles',
        method: 'post',
        data: data
    })
}


// 详情查询
export function getArticleById(id) {
  return request({
    url: '/articles/' + id,
    method: 'get'
  })
}

